Aerial Image Analytics | Mother Earth

Author : Deepika Sharma Date : Oct 2020 - Mar 2021

Folder structure:

  1. Input(train) data ~13,000 images.
  2. Annotation : Image labels for each class cloud_shadow, double_plant, planter_skip, standing_water, waterway, weed_cluster are made avaiable under separate folders with labels as 255 where there sis cloud_shadow 0 otherwise, 255 where there is double_palnt 0 otherwise and so on..
  3. Test : ~3800 images for testing.

Steps:

Step 1: Data preparation

For training, each image is converted in to binary image, where 0's represent background and 1,2,3,4,5,6's represent the classes in each image.


Encoding is done as following:

  1. Standing water = 1
  2. Double plant = 2
  3. Planter skip = 3
  4. Weed cluster = 4
  5. Standing water = 5
  6. Cloud shadow = 6

Each annotated image has data encoded using 0(background),1,2,3,4,5,6.

Step 2: Model (Keras vgg_unet) training on ~13000 images with n_classes=7 , input_height=512, input_width=512.
Step 3: Prediction on ~3800 images

Each predicted image will have image with each pixcel value as either 0/1/2/3/4/5/6. For better visual representation, these numbers are scaled futher such that output images can have better class distinction.

Step 1: Data Preparation

Import libraries

Visualisation

Let's visualise the images and respective annotated images

Data Preparation part 1

Notes:

  1. For data preparation, I am encoding each class with a unique prime number to ensure that each class is uniquely identified even if they overlap in image.

  2. For ex, if classes were encoded as 1,2,3,4,5,6, when summing all the images to create one annotated image for training, if 1 and 5 overlapped, there will be entry for 6 (1+5) and actual 6

Few more notes:

  1. If classes overlapped, the sum of all the classes will not be one among numbers used for encoding, which are set([1,3,5,11,23,53])

  2. Let's remove them and encode the classes as 1,2,3,4,5 such that during model training num_of_classes can be input as 6, else model will pick maximum number available in an image as num of classes.

Step 2.1: Model Training (Single Model for 6 classes)

The accuracy does not seem to look good. Since I have tried training the model with 6 classes using various pre-processing techniques, I will move onto training different model for diffrent class and ensamble the results to see prediction.

Data Preparation part 2

Data Preparation is Done!

Step 2.2: Model Training , one model for each class

Step 3: Prediction

math.floor(waterway_n)